#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Create by zhang
# Create on 2022/6/27 21:51
from domain.report.dto.balance_sheet_dto import BalanceSheetSchema
from domain.report.extractor.base_filter import BaseFilter
from domain.report.common.extract_content_enum import ExtractContentEnum
from domain.report.extractor.request import TaskData


class ConsolidatedBalanceSheetFilter(BaseFilter):
    start_titles = [
        "货币资金", "附注"
    ]

    item_titles = []

    end_titles = [
        "负债和所有者权益（或股东权益）总计", "负债和所有者权益总计", "负债和股东权益总计"
    ]

    def __init__(self):
        super(ConsolidatedBalanceSheetFilter, self).__init__()

    def init(self):
        self.extract_type = ExtractContentEnum.ConsolidatedBalanceSheet
        self.exclude_type = []
        self.result = TaskData(name=self.extract_type.name)
        self.result.set(self.extract_type.name, [])
        self.__class__.item_titles = BalanceSheetSchema.get_all_titles()